package com.cardone.platform.authority.service;

import java.util.List;

import lombok.Getter;
import lombok.Setter;

import com.cardone.common.dto.PaginationDto;
import com.cardone.context.ContextHolder;
import com.cardone.platform.authority.dao.PeVaRuTransactModeDao;
import com.cardone.platform.authority.dto.PeVaRuTransactModeDto;

/**
 * 许可、验证规则与处理模式服务
 *
 * @author yaohaitao
 *
 */
@Getter
@Setter
public class PeVaRuTransactModeDefaultService implements PeVaRuTransactModeService {
	@Override
	public int deleteByIds(final PeVaRuTransactModeDto deletePeVaRuTransactMode) {
		return ContextHolder.getBean(PeVaRuTransactModeDao.class).deleteByIds(deletePeVaRuTransactMode);
	}

	@Override
	public <P> P findByCodeOrId(final Class<P> mappedClass, final PeVaRuTransactModeDto findPeVaRuTransactMode) {
		return ContextHolder.getBean(PeVaRuTransactModeDao.class).findByCodeOrId(mappedClass, findPeVaRuTransactMode);
	}

	@Override
	public <P> P findById(final Class<P> mappedClass, final PeVaRuTransactModeDto findPeVaRuTransactMode) {
		return ContextHolder.getBean(PeVaRuTransactModeDao.class).findById(mappedClass, findPeVaRuTransactMode);
	}

	@Override
	public <P> List<P> findListByLikeCode(final Class<P> mappedClass, final PeVaRuTransactModeDto findListPeVaRuTransactMode) {
		return ContextHolder.getBean(PeVaRuTransactModeDao.class).findListByLikeCode(mappedClass, findListPeVaRuTransactMode);
	}

	@Override
	public int insertByCode(final PeVaRuTransactModeDto insertPeVaRuTransactMode) {
		return ContextHolder.getBean(PeVaRuTransactModeDao.class).insertByCode(insertPeVaRuTransactMode);
	}

	@Override
	public <P> PaginationDto<P> paginationByLikeCode(final Class<P> mappedClass, final PeVaRuTransactModeDto paginationPeVaRuTransactMode) {
		return ContextHolder.getBean(PeVaRuTransactModeDao.class).paginationByLikeCode(mappedClass, paginationPeVaRuTransactMode);
	}

	@Override
	public Integer readByCodeNqIdForCount(final PeVaRuTransactModeDto readPeVaRuTransactMode) {
		return ContextHolder.getBean(PeVaRuTransactModeDao.class).readByCodeNqIdForCount(readPeVaRuTransactMode);
	}

	@Override
	public <P> P saveByIdOrCode(final Class<P> mappedClass, final PeVaRuTransactModeDto savePeVaRuTransactMode) {
		return ContextHolder.getBean(PeVaRuTransactModeDao.class).saveByIdOrCode(mappedClass, savePeVaRuTransactMode);
	}

	@Override
	public int updateByCode(final PeVaRuTransactModeDto updatePeVaRuTransactMode) {
		return ContextHolder.getBean(PeVaRuTransactModeDao.class).updateByCode(updatePeVaRuTransactMode);
	}
}